package com.spdd.mt.common.thread;


import lombok.Getter;

import java.util.Objects;

/**
 * 线程池类型
 *
 * @author shanfeilong
 */
@Getter
public enum ThreadPoolTypeEnum {

    /** 公用线程池 */
    COMMON(1, "common"),
    ;

    private final Integer code;

    private final String message;

    ThreadPoolTypeEnum(Integer code, String message) {
        this.code = code;
        this.message = message;
    }

    public static ThreadPoolTypeEnum getEnum(Integer v) {
        if (null == v) {
            return null;
        }

        ThreadPoolTypeEnum[] var1 = values();
        int var2 = var1.length;

        for (ThreadPoolTypeEnum threadPoolTypeEnum : var1) {
            if (Objects.equals(v, threadPoolTypeEnum.getCode())) {
                return threadPoolTypeEnum;
            }
        }

        return null;
    }
}
